package leetCode.offer53;

public class Solution1 implements Solution{

    public int search(int[] nums, int target) {
        int num=0;
        int result=0;
        for(int i=0;i<nums.length;i++){
            if(target==nums[i]){
                num=i;
                result++;
                break;
            }
        }
        for(int i=num+1;i<nums.length;i++){
            if(target!=nums[i]){
                break;
            }
            result++;
        }
        return result;
    }

    public static void main(String[] args) {
        int[] param = {5,7,7,8,8,10};
        System.out.println(new Solution1().search(param,6));
    }
}
